﻿@model DataAccess.DB.NhapKho

@{
    ViewBag.Title = "Nhập kho";
    Layout = "~/Views/Shared/_Layout_Printf.cshtml";
    
    
}
<table>
    <tr>
        <td>
            <span>Cty CP dược VTYT Thái Bình - Kho OTC</span>
        </td>
        <td style="text-align: right">
            <span>Ngày</span> @DateTime.Now.Day <span>Tháng </span>@DateTime.Now.Month <span>Năm</span> @DateTime.Now.Year
        </td>
    </tr>
    <tr>
        <td style="padding-left: 38px">
            <span>0363841892</span> - <span>0363847620</span>
        </td>
        <td style="text-align: right"></td>
    </tr>
    <tr>
        <td colspan="2" style="text-align: center">
            <h1>Thống kê bán hàng</h1>
        </td>
    </tr>
</table>
<table>

    <tr>
        <td class="display-label" style="width: 30%">
            <span>Mã hóa đơn: </span>
        </td>
        <td class="display-field">
            @Html.DisplayFor(model => model.MaHoaDon)
        </td>
    </tr>
    <tr>
        <td class="display-label">
            <span>Ngày nhập kho :</span>
        </td>
        <td class="display-field">
            @Html.DisplayFor(model => model.NgayNhapKho)
        </td>
    </tr>
    <tr>
        <td class="display-label">
            <span>Đơn vị cung cấp: </span>
        </td>
        <td class="display-field">
            @Html.DisplayFor(model => model.DVCC.TenDVCC)
        </td>
    </tr>
    @*<tr>
        <td class="display-label">
            <span>Nhân viên nhập kho: </span>
        </td>
        <td class="display-field">
            @Html.DisplayFor(model => model.NhanVien.HoTen)
        </td>
    </tr>*@

    <tr>
        <td class="display-label">
            <span>Tổng thanh toán:</span>
        </td>
        <td class="display-field">
            @Html.DisplayFor(model => model.TongThanhToan)
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <table class="ms-form-table-hd">

                <tr>
                    <th>STT</th>
                    <th>Mã sản phẩm</th>
                    <th>Đơn vị tính</th>
                    <th>Số lượng</th>
                    <th>Giá</th>
                    <th>Thành tiền</th>
                    <th>HSD</th>
                    <th>Mã kho</th>
                </tr>
                @{string[] listmasanpham = @ViewBag.listmasp;
                  string[] listSoluong = @ViewBag.listsoLuong;
                  string[] listgia = @ViewBag.listgia;
                  string[] listDonvi = @ViewBag.listDonvi;
                  string[] listHSD = @ViewBag.listHSD;
                  string[] listMaKho = @ViewBag.listMaKho;
                }
                @for (int i = 0; i < listmasanpham.Length; i++)
                {
                    if (!string.IsNullOrEmpty(listmasanpham[i]))
                    {
                        var gia = DuocThaiBinh.Common.Util.ConvertCurrencyToMoney(listgia[i]);
                        var thanhtien = DuocThaiBinh.Common.Util.ConvertDecimaToCurrency(gia * DuocThaiBinh.Common.Util.ConvertObjectToIn(listSoluong[i]));
                    <tr>
                        <td>
                            @{int k = i + 1;
                                <span>@k</span>}
                        </td>
                        <td>
                            @listmasanpham[i]
                        </td>
                        <td>
                            @listDonvi[i]
                        </td>
                        <td>
                            @listSoluong[i]
                        </td>
                        <td>
                            @listgia[i]
                        </td>
                        <td>@thanhtien</td>
                        <td>
                            @listHSD[i]
                        </td>
                        <td>
                            @listMaKho[i]
                        </td>
                    </tr>
                    }
                }
            </table>
        </td>
    </tr>
</table>

